home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CUJ9209.ARJ
/
1009047B
< prev
next >
Wrap
Text File
|
1992-04-03
|
695b
|
32 lines
/*** LISTING 5 ***/
/*** ***/
/*** sin.c ***/
/*** **************************************** ***/
/*** INPUT A CHARACTER FROM SERIAL PORT ***/
/*** **************************************** ***/
#include "serial.h"
#include <time.h>
extern int portbase;
int SerialIn()
{
int Char_Value;
clock_t start, timeout;
start = clock();
while((inp(portbase + LSR) & RCVRDY) == 0)
{
timeout = clock();
if((timeout-start) > 1)
{
return(-1);
}
}
Char_Value = inp(portbase + RXR);
return (Char_Value);
}